const app = getApp(); //引入自定义头部导航

var util = require('../../utils/common.js'); //引入公共JS


import { MyQuestion } from 'myQuestion_model.js';
var myQuestion = new MyQuestion();
Page({
  data: {
    showIcon: true,
    //显示返回键以及首页
    _id: 0,
    //默认显示演出问答
    _list: 0 //默认显示演出问答列表

  },
  onLoad: function () {
    var state = 'yan';
    this.data.state = state;

    this._onLoad();
  },
  _onLoad: function () {
    myQuestion.getDetails(this.data.state, res => {
      this.setData({
        'Details': res
      });
    });
  },
  //点击切换演出问答和景点问答
  questionClick: function (e) {
    var _id = e.target.dataset.id;
    var state = e.target.dataset.state;
    this.data.state = state;
    myQuestion.getDetails(this.data.state, res => {
      this.setData({
        _id: _id,
        _list: _id,
        'tails': res
      });
    });
  },
  //分享
  onShareAppMessage: function () {
    util.sharePage();
  }
});